// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)
let casehistoryfrontlistUrl = '/front/casefront/casehistoryfrontlist';
let insertCaseFrontUrl = '/front/casefront/insertCaseFront';
let casefrontinfoUrl = '/front/casefront/casefrontinfo';
let updateCaseFrontUrl = '/front/casefront/updateCaseFront';
let updatephoneUrl = '/front/studentfront/updatephone';


//安全宣传
let selectpublictimeUrl = '/front/safetypublicfront/selectpublictime';
let publicityinfodetailedUrl = '/front/safetypublicfront/publicityinfodetailed';
let selectpublicitytypeUrl = '/front/safetypublicfront/selectpublicitytype';

//考试
let selectexaminationinfoUrl = '/front/safetyexaminationfront/selectexaminationinfo';
//考试题目
let selectExaminationFrontUrl = '/front/safetyexaminationfront/selectExaminationFront';
//考试保存
let saveExaminationUrl = '/front/safetyexaminationfront/saveExamination';
//广告
let selectrecommendUrl = '/front/merchantfront/selectrecommend';
//字典
let selectdicUrl = '/front/studentfront/selectdic';

//登录
let loginUrl = '/front/studentfront/login';
//学生信息记录
let writeUserUrl = '/front/studentfront/writeUser';
//学生信息读取
let readUserUrl = '/front/studentfront/readUser';

//商户登录
let loginMerchantUrl = '/front/merchantfront/loginMerchant';
//获取商户奖品信息
let selectMerchantPrizeInfoUrl = '/front/merchantfront/selectMerchantPrizeInfo';
//扫码领奖
let updatePrizeTypeUrl = '/front/merchantfront/updatePrizeType';
//学生成绩统计
let selectExaminationFrontResultUrl = '/front/safetyexaminationfront/selectExaminationFrontResult';
//抽奖
let luckDrawUrl = '/front/safetyexaminationfront/luckDraw';





// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	// 此处没有使用传入的params参数
	let getcasehistory = (params = {}) => vm.$u.get(casehistoryfrontlistUrl, params);

	// 此处使用了传入的params参数，一切自定义即可
	let insertCaseFront = (params = {}) => vm.$u.post(insertCaseFrontUrl, params);

	let casefrontinfo = (params = {}) => vm.$u.post(casefrontinfoUrl, params);

	let updateCaseFront = (params = {}) => vm.$u.post(updateCaseFrontUrl, params);

	let updatephone = (params = {}) => vm.$u.post(updatephoneUrl, params);
	//安全宣传
	let selectpublictime = (params = {}) => vm.$u.get(selectpublictimeUrl, params);
	let publicityinfodetailed = (params = {}) => vm.$u.post(publicityinfodetailedUrl, params);
	let selectpublicitytype = (params = {}) => vm.$u.get(selectpublicitytypeUrl, params);

	//考试
	let selectexaminationinfo = (params = {}) => vm.$u.get(selectexaminationinfoUrl, params);
	//考试题目
	let selectExaminationFront = (params = {}) => vm.$u.get(selectExaminationFrontUrl, params);
	//考试保存
	let saveExamination = (params = {}) => vm.$u.post(saveExaminationUrl, params);
	//广告
	let selectrecommend = (params = {}) => vm.$u.get(selectrecommendUrl, params);
	//字典
	let selectdic = (params = {}) => vm.$u.get(selectdicUrl, params);


	//登录
	let login = (params = {}) => vm.$u.post(loginUrl, params);
	//学生信息记录
	let writeUser = (params = {}) => vm.$u.post(writeUserUrl, params);
	//学生信息读取
	let readUser = (params = {}) => vm.$u.post(readUserUrl, params);
	//商户登录
	let loginMerchant = (params = {}) => vm.$u.post(loginMerchantUrl, params);
	//商户获取奖品信息
	let selectMerchantPrizeInfo = (params = {}) => vm.$u.post(selectMerchantPrizeInfoUrl, params);
	//扫码
	let updatePrizeType = (params = {}) => vm.$u.post(updatePrizeTypeUrl, params);
	//学生成绩统计
	let selectExaminationFrontResult = (params = {}) => vm.$u.get(selectExaminationFrontResultUrl, params);
	//抽奖
	let luckDraw = (params = {}) => vm.$u.get(luckDrawUrl, params);

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		getcasehistory,
		insertCaseFront,
		casefrontinfo,
		updateCaseFront,
		selectpublictime,
		publicityinfodetailed,
		selectexaminationinfo,
		selectExaminationFront,
		saveExamination,
		updatephone,
		selectrecommend,
		selectpublicitytype,
		selectdic,
		login,
		writeUser,
		readUser,
		loginMerchant,
		selectMerchantPrizeInfo,
		updatePrizeType,
		selectExaminationFrontResult,
		luckDraw
	};
}

export default {
	install
}
